package com.whfc.iot.mach.codec;

import com.whfc.iot.mach.entity.MachMsg0x8A;
import io.netty.buffer.ByteBuf;

/**
 * @Description:
 * @author: xugcheng
 * @version: 1.0
 * @date: 2019/7/17 9:32
 */
public class MachMsgDataCodec0x8A implements MachMsgDataCodec<MachMsg0x8A> {

    @Override
    public void decode(ByteBuf buf, MachMsg0x8A msg) {
        int result = buf.readUnsignedByte();
        msg.setResult(result);
    }

    @Override
    public void encode(ByteBuf buf, MachMsg0x8A msg) {
        buf.writeByte(msg.getResult());
    }
}